var GridSetting = {
    url: $path_base + 'admin/adminRole/AjaxList',
    editurl: $path_base + "admin/adminRole/edit",
    exitsts : $path_base + "admin/adminRole/exists",
    validateurl : $path_base + "admin/adminRole/validator",
    colNames:['任务', '编号','角色名称','角色描述'],
    colModel:[
        {
            name:'myac',index:'', width:80, fixed:true, sortable:false, resize:false,search:false,
            formatter:'actions',
            formatoptions:{keys:true,delOptions:{recreateForm: true, beforeShowForm: MyGrid.beforeDeleteCallback}}
        },
        {name:'role_id',index:'role_id', key:true, width:60, sorttype:"int", editable: false},
        {
            name:'role_name',index:'role_name', width:150,editable: true,
            editoptions:{size:"20",maxlength:"50"},
            formoptions:{elmprefix:'<span style="color:red">*</span>'},
            editrules : {
                required: true,
                custom:true,
                custom_func:function(val,name, index)
                {
                    var data = { role_name : val , role_id : MyGrid.Instance.jqGrid('getGridParam', 'selrow')};
                    var url = GridSetting.exitsts;
                    return MyGrid.exists(url, data);
                }
            }
        },
        {name:'role_description',index:'role_description', width:150, sortable:false,editable: true,edittype:"textarea", editoptions:{rows:"2",cols:"10"}}
    ],
    prmNames: {
        id:"role_id"
    },
    jsonReader: {
        id: "role_id"
    }
};
MyGrid.createGrid(GridSetting);